package com.spring.mvc.mina.test.demo;

public class RspHandler {
	
	private byte[] rsp=null;

	public synchronized boolean handleResponse(byte[] rspData) {
		this.rsp=rspData;
		this.notify();
		return true;
	}

	public synchronized void waitForResponse(){
		while(this.rsp==null){
			try{
				this.wait();
			}catch(InterruptedException e){
				e.printStackTrace();
			}
		}
		System.out.println(new String(this.rsp));
	}
}
